/*
 * @Descripttion:
 * @version: 1.0.0
 * @Author: YinJianFeng
 * @Date: 2024-03-28 18:57:44
 */
import { Login, URL_INFO } from '@amcax/base';
import '@app-cad/common/utils/i18next';
import { BrowserRouter, Route, Switch } from 'react-router-dom';
import './App.css';
import './variable.css';
import Index from './pages/Index';
import './electronCenter';
// import Index from '@app-nextmesh/pages/Index'
declare global {
  interface Window {
    __MICRO_APP_ENVIRONMENT__: any;
  }
}
function App() {
  if (!window.location.href.includes('/login')) {
    sessionStorage.setItem(URL_INFO, window.location.href);
  }
  const windows: any = window;
  return (
    <BrowserRouter basename={windows.__MICRO_APP_BASE_ROUTE__ || '/'}>
      <Switch>
        {!window.__MICRO_APP_ENVIRONMENT__ && (
          <Route
            path='/login'
            component={Login}
          />
        )}
        <Route
          path='/'
          component={Index}
        />
      </Switch>
    </BrowserRouter>
  );
}

export default App;
